home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / pdox693.zip / TI682.ASC < prev    next >
Text File  |  1993-05-07  |  3KB  |  133 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Paradox                                NUMBER  :  682
  9.   VERSION  :  All
  10.        OS  :  DOS
  11.      DATE  :  May 7, 1993                              PAGE  :  1/2
  12.  
  13.     TITLE  :  Converting Text Fields to Initial Caps
  14.  
  15.  
  16.  
  17.  
  18.   It is sometimes desirable to format all of the words in an
  19.   Alphanumeric field to initial capitals.  For example, if the data
  20.   in a Name fields reads "ED SMITH", you may want it to read "Ed
  21.   Smith".  This can be accomplished by using a PAL script.
  22.  
  23.   The example shown below illustrates how you can use the PAL SCAN
  24.   command, FORMAT function and LOWER function to convert the data
  25.   in an Alphanumeric field to initial capitals.  In your script,
  26.   you will need to substitute your table name for TBLNAME, and you
  27.   will need to substitute the field name that you wish to change
  28.   for FLDNAME.
  29.  
  30.   Before making global changes to your table, it is a good idea to
  31.   first make a backup copy.
  32.  
  33.  
  34.   Creating the script
  35.  
  36.      1.  From the Paradox Main menu, choose Scripts | Editor | New
  37.          (for version 3.5 and earlier, choose Scripts | Editor |
  38.          Write).
  39.  
  40.      2.  When prompted, type in a name for the script (for example,
  41.          CAPS), then press [Enter].
  42.  
  43.      3.  Type in the following PAL code:
  44.  
  45.          Coedit "TBLNAME"                 ; Substitute your table
  46.                                           ;  name for TBLNAME
  47.          Moveto [FLDNAME]                 ; Substitute your field
  48.                                           ;   name for FLDNAME
  49.          Scan                             ; Scans every record
  50.               []=Format("CC", Lower([]))  ; Converts field to
  51.                                           ;   initial caps.
  52.          Endscan
  53.  
  54.      4.  When you are finished typing the PAL code, press [F2] to
  55.          save your script.
  56.  
  57.    
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Paradox                                NUMBER  :  682
  75.   VERSION  :  All
  76.        OS  :  DOS
  77.      DATE  :  May 7, 1993                              PAGE  :  2/2
  78.  
  79.     TITLE  :  Converting Text Fields to Initial Caps
  80.  
  81.  
  82.  
  83.  
  84.   To play the script
  85.  
  86.      1.  From the Main menu, choose Scripts | Play.
  87.  
  88.      2.  When prompted, type in the name of your script, then press
  89.          [Enter].
  90.  
  91.  
  92.   For information on the SCAN command, FORMAT function and LOWER
  93.   function, refer to the PAL Reference manual (for version 3.5 and
  94.   earlier, refer to the PAL User's Guide).
  95.  
  96.  
  97.   DISCLAIMER: You have the right to use this technical information
  98.   subject to the terms of the No-Nonsense License Statement that
  99.   you received with the Borland product to which this information
  100.   pertains.
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.